<template>
	<view>
		<u-sticky bgColor="#fff">
			<u-tabs :list="listF" @click="clickF" :current='bigcurrent' :scrollable='false'></u-tabs>
		</u-sticky>
		<u-sticky bgColor="#fff">
			<u-tabs :list="tabid==1?listS:list3" :current='current' @click="changeS" :scrollable='false'></u-tabs>
		</u-sticky>
	</view>
</template>

<script>
	export default {
		props: {
			listF: {
				type: Array,
				default: []
			},
			listS: {
				type: Array,
				default: []
			},
			bigcurrent: {
				type: Number,
				default: 0
			},
			current: {
				type: Number,
				default: 0
			}
		},
		name: "mytabs",
		mounted() {
			if(this.bigcurrent == 1){
				this.tabid = 2
			}
		},
		data() {
			return {
				tabid: 1,
				list3: [{
					name: '代寄件',
					id: '00'
				}, {
					name: '已寄件',
					id: 11
				}, 
				{
					name: '已送达',
					id: 11
				}, {
					name: '寄件失败',
					id: 22
				}],
			};
		},

		methods: {
			
			clickF(index) {
				if(index.id!=null){
					this.tabid = index.id
					this.$emit('bigtabchange',index.index)
				}else{
					this.$emit('bigtabchange',index.index)
				}
			},
			changeS(index) {
				// console.log(index.index);
				this.$emit('changcurrent', index.index)
			},
		}
	}
</script>

<style lang="scss">

</style>